package tcpEcho;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class DicServer extends Server {
    Map<String,String> map = new HashMap<>();
    DicServer(int port) throws IOException {
        super(port);
        map.put("hello","你好");
        map.put("good","好的");
        map.put("long","长的" );
    }
    @Override
    public String process(String request){
        return map.getOrDefault(request,"没有你要找的单词");
    }

    public static void main(String[] args) throws IOException {
        DicServer dicServer = new DicServer(2020);
        dicServer.start();
    }
}

